import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/Parents/Home'
import Index from '@/components/Index'
import test from '@/components/test'
import ShowFilms from '@/components/ShowFilms'
import Search from '@/components/Search'
import ShowMore from '@/components/ShowMore'
import AboutUs from '@/components/AboutUs'
import AllTypes from '@/components/Parents/AllTypes'
import AllFilms from '@/components/Types/AllFilms'
import Recommend from '@/components/Types/Recommend'
import love from '@/components/Types/love'
import science from '@/components/Types/science'
import animation from '@/components/Types/animation'
import others from '@/components/Types/others'


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Home',
      component: Home,
      redirect:"/index",
      children:[
      
        { path: '/aboutUs', name: 'AboutUs', component: AboutUs},
        // props: true 用于开启接收路由参数  注意传的参数要保持一致
        { path: '/showFilms/:id', name: 'ShowFilms', component: ShowFilms, props: true },
        { 
          path: '/allTypes',
          name: 'AllTypes', 
          component: AllTypes,
          redirect:"/allFilms",
          children:[
            { path: '/index', name: 'Index', component: Index},
            { path: '/allFilms',  name: 'AllFilms', component: AllFilms },
            { path: '/recommend', name: 'Recommend', component: Recommend},
            { path: '/love', name: 'love', component: love},
            { path: '/science', name: 'science', component: science},
            { path: '/animation', name: 'animation', component: animation},
            { path: '/others', name: 'others', component: others},
          ]
        },

      ]
    },
    {
      path: '/search',
      name: 'Search',
      component: Search
    },
    {
      path: '/showMore/:id',  //注意传的参数要保持一致
      name: 'ShowMore',
      component: ShowMore,
      props: true  // props: true 用于开启接收路由参数
    },
    {
      path: '/test',
      name: 'test',
      component: test
    },
    
  ],
  linkActiveClass:'myactive'
})
